package cn.edu.scau.cmi.dengzejun.chapter08;

public class CargoBoat {
	int realConent;
	int maxConent;
	
	public void setMaxConent(int c) {
		maxConent=c;
		return;
	}
	
	public void loading(int m) throws DangerException{
		realConent+=m;
		if (realConent>maxConent) {
			throw new DangerException();
		}
		System.out.println("it had loaded "+realConent+" tons goods now.");
		return;
	}
}
